// 主题 配置

$curThemeName: "light"; // 默认主题

$themes: (
  light: (
    bgColor: #f5f5f5,
    textColor: #333,
  ),
  dark: (
    bgColor: #333,
    textColor: #f5f5f5,
  ),
);

@mixin useTheme() {
  @each $key, $value in $themes {
    $curThemeName: $key !global;
    html[data-theme="#{$key}"] & {
      @content;
    }
  }
}

@function getVar($key) {
  // 获取当前主题
  $themeMap: map-get($themes, $curThemeName);
  @return map-get($themeMap, $key);
}
